<?php
class admin_index extends Controller{
	public function index(){

		$setting =$this->load->Module('setting/admin');
		$this->template=$this->config->config['admin_template'];
		$data=array(
			'update_footer'=>'merci de saissir votre mots de passe',
			'admin_title'=>'Page Admin',
			);
	if($this->input->cookie('admin',TRUE))
		$_SESSION['admin']=$this->input->cookie('admin',TRUE);
	if(isset($_SESSION['admin'])){
		$this->load->helper('url');
		global $CFG;
		if(isset($_SESSION['back_url'])){
			$url=$_SESSION['back_url'];
			unset($_SESSION['back_url']);
		}else $url=$CFG->config['base_url'].'product/admin';

		redirect($url);
	}
	$this->view(
			array('admin-header',
					'login',
					'admin-footer'),
			$data); // Display the page
	}
	
	
}